import * as actionTypes from '../constants'

const defaultState = {
  current_nav: '',
  categoryList: []
}

function reducer(state = defaultState, action) {
  const { data, type } = action

  switch (type) {
    case actionTypes.CURRENT_LEFT_NAV:
      return { ...state, current_nav: data }
    case actionTypes.SAVE_CATEGORY_LIST:
      return { ...state, categoryList: data }
    default:
      return state
  }
}

export default reducer






